# -*- coding: utf-8 -*-
from PhysicObject import *

class Goal(PhysicObject):
    image = load_image('images/end.png')

    def __init__(self, world, x, y):
        self.world = world
        bodyDef = box2d.b2BodyDef()
        bodyDef.position = (x, y)
        bodyDef.userData = self
        self.body = self.world.world.CreateBody(bodyDef)
        shapeDef = box2d.b2PolygonDef()
        shapeDef.SetAsBox(0.5, 0.5)
        self.body.CreateShape(shapeDef)
       
    def draw( self, surface, offset_x, offset_y ):
        pos = self.body.GetPosition()

        surface.blit(self.image, (int(pos.x*10)-offset_x,
                                  int(pos.y*10)-offset_y))
